function ProductDetails(params){ 
	 
}

ProductDetails.Where = function(type,proxy){
	this.type = type;
	this.proxy=proxy;
	this.linked = null;
	this.set = null;
	if(this.type==0){
		this.set = new ProductDetails.Where(1,true);
		this.set.linked = this;
	}
	this.getProxy = function(){
		var m = new ProductDetails.Where(this.type);//当前的对像
		if(this.type==0){
			m.set = new ProductDetails.Where(1,true);//set对象
			m.set.linked = m;
		}else{
			m.linked=this.linked;
			this.linked.linked=m;
		}
		return m;
	}
	this.data = {};
	this.put = function(key,value){
		this.data[key] = value;
	}
	this.get = function(key){
		return this.data[key];
	}
	/** 编号 [非空]       **/
	this.id=function(id){if(this.proxy)return this.getProxy().id(id);  this.put("id", id);return this;};
	/** and id is null */
	this.idNull=function(){if(this.proxy)return this.getProxy().idNull();if(this.get("idNot")==null)this.put("idNot", "");this.put("id", null);return this;};
	/** not .... */
	this.idNot=function(){if(this.proxy)return this.getProxy().idNot();this.put("idNot", "not");return this;};
	this.idNotNull=function(){if(this.proxy)return this.getProxy().idNotNull();this.put("idNot", "not");this.put("id", null);return this;};
	this.idNot=function(id){if(this.proxy)return this.getProxy().idNot(id);this.put("idNot", "not");this.put("id", id);return this;};
	/** and id <= ? */
	this.idMin=function(min){if(this.proxy)return this.getProxy().idMin(min);this.put("idMin", min);return this;};
	/** and id >= ? */
	this.idMax=function(max){if(this.proxy)return this.getProxy().idMax(max);this.put("idMax", max);return this;};
	this.idIn=function(ids){
		if(this.proxy)return this.getProxy().idIn(ids);  this.put("idIn", ids);return this;
	};	
	
	/** 获得方式        **/
	this.ways=function(ways){if(this.proxy)return this.getProxy().ways(ways);  this.put("ways", ways);return this;};
	/** and ways is null */
	this.waysNull=function(){if(this.proxy)return this.getProxy().waysNull();if(this.get("waysNot")==null)this.put("waysNot", "");this.put("ways", null);return this;};
	/** not .... */
	this.waysNot=function(){if(this.proxy)return this.getProxy().waysNot();this.put("waysNot", "not");return this;};
	this.waysNotNull=function(){if(this.proxy)return this.getProxy().waysNotNull();this.put("waysNot", "not");this.put("ways", null);return this;};
	this.waysNot=function(ways){if(this.proxy)return this.getProxy().waysNot(ways);this.put("waysNot", "not");this.put("ways", ways);return this;};
	
	/** 品牌信息  [Merchant]      **/
	this.brand=function(brand){if(this.proxy)return this.getProxy().brand(brand);  this.put("brand", brand);return this;};
	/** and brand is null */
	this.brandNull=function(){if(this.proxy)return this.getProxy().brandNull();if(this.get("brandNot")==null)this.put("brandNot", "");this.put("brand", null);return this;};
	/** not .... */
	this.brandNot=function(){if(this.proxy)return this.getProxy().brandNot();this.put("brandNot", "not");return this;};
	this.brandNotNull=function(){if(this.proxy)return this.getProxy().brandNotNull();this.put("brandNot", "not");this.put("brand", null);return this;};
	this.brandNot=function(brand){if(this.proxy)return this.getProxy().brandNot(brand);this.put("brandNot", "not");this.put("brand", brand);return this;};
	this.brandIn=function(ids){
		if(this.proxy)return this.getProxy().brandIn(ids);  this.put("brandIn", ids);return this;
	};	
	
	/** 所属会员  [Member]      **/
	this.member=function(member){if(this.proxy)return this.getProxy().member(member);  this.put("member", member);return this;};
	/** and member is null */
	this.memberNull=function(){if(this.proxy)return this.getProxy().memberNull();if(this.get("memberNot")==null)this.put("memberNot", "");this.put("member", null);return this;};
	/** not .... */
	this.memberNot=function(){if(this.proxy)return this.getProxy().memberNot();this.put("memberNot", "not");return this;};
	this.memberNotNull=function(){if(this.proxy)return this.getProxy().memberNotNull();this.put("memberNot", "not");this.put("member", null);return this;};
	this.memberNot=function(member){if(this.proxy)return this.getProxy().memberNot(member);this.put("memberNot", "not");this.put("member", member);return this;};
	this.memberIn=function(ids){
		if(this.proxy)return this.getProxy().memberIn(ids);  this.put("memberIn", ids);return this;
	};	
	
	/** 商品信息  [Commodity]      **/
	this.commodity=function(commodity){if(this.proxy)return this.getProxy().commodity(commodity);  this.put("commodity", commodity);return this;};
	/** and commodity is null */
	this.commodityNull=function(){if(this.proxy)return this.getProxy().commodityNull();if(this.get("commodityNot")==null)this.put("commodityNot", "");this.put("commodity", null);return this;};
	/** not .... */
	this.commodityNot=function(){if(this.proxy)return this.getProxy().commodityNot();this.put("commodityNot", "not");return this;};
	this.commodityNotNull=function(){if(this.proxy)return this.getProxy().commodityNotNull();this.put("commodityNot", "not");this.put("commodity", null);return this;};
	this.commodityNot=function(commodity){if(this.proxy)return this.getProxy().commodityNot(commodity);this.put("commodityNot", "not");this.put("commodity", commodity);return this;};
	this.commodityIn=function(ids){
		if(this.proxy)return this.getProxy().commodityIn(ids);  this.put("commodityIn", ids);return this;
	};	
	
	/** 价格        **/
	this.price=function(price){if(this.proxy)return this.getProxy().price(price);  this.put("price", price);return this;};
	/** and price is null */
	this.priceNull=function(){if(this.proxy)return this.getProxy().priceNull();if(this.get("priceNot")==null)this.put("priceNot", "");this.put("price", null);return this;};
	/** not .... */
	this.priceNot=function(){if(this.proxy)return this.getProxy().priceNot();this.put("priceNot", "not");return this;};
	this.priceNotNull=function(){if(this.proxy)return this.getProxy().priceNotNull();this.put("priceNot", "not");this.put("price", null);return this;};
	this.priceNot=function(price){if(this.proxy)return this.getProxy().priceNot(price);this.put("priceNot", "not");this.put("price", price);return this;};
	/** and price <= ? */
	this.priceMin=function(min){if(this.proxy)return this.getProxy().priceMin(min);this.put("priceMin", min);return this;};
	/** and price >= ? */
	this.priceMax=function(max){if(this.proxy)return this.getProxy().priceMax(max);this.put("priceMax", max);return this;};
	
	/** 数量        **/
	this.number=function(number){if(this.proxy)return this.getProxy().number(number);  this.put("number", number);return this;};
	/** and number is null */
	this.numberNull=function(){if(this.proxy)return this.getProxy().numberNull();if(this.get("numberNot")==null)this.put("numberNot", "");this.put("number", null);return this;};
	/** not .... */
	this.numberNot=function(){if(this.proxy)return this.getProxy().numberNot();this.put("numberNot", "not");return this;};
	this.numberNotNull=function(){if(this.proxy)return this.getProxy().numberNotNull();this.put("numberNot", "not");this.put("number", null);return this;};
	this.numberNot=function(number){if(this.proxy)return this.getProxy().numberNot(number);this.put("numberNot", "not");this.put("number", number);return this;};
	/** and number <= ? */
	this.numberMin=function(min){if(this.proxy)return this.getProxy().numberMin(min);this.put("numberMin", min);return this;};
	/** and number >= ? */
	this.numberMax=function(max){if(this.proxy)return this.getProxy().numberMax(max);this.put("numberMax", max);return this;};
	this.numberIn=function(ids){
		if(this.proxy)return this.getProxy().numberIn(ids);  this.put("numberIn", ids);return this;
	};	
	
	/** 充        **/
	this.chong=function(chong){if(this.proxy)return this.getProxy().chong(chong);  this.put("chong", chong);return this;};
	/** and chong is null */
	this.chongNull=function(){if(this.proxy)return this.getProxy().chongNull();if(this.get("chongNot")==null)this.put("chongNot", "");this.put("chong", null);return this;};
	/** not .... */
	this.chongNot=function(){if(this.proxy)return this.getProxy().chongNot();this.put("chongNot", "not");return this;};
	this.chongNotNull=function(){if(this.proxy)return this.getProxy().chongNotNull();this.put("chongNot", "not");this.put("chong", null);return this;};
	this.chongNot=function(chong){if(this.proxy)return this.getProxy().chongNot(chong);this.put("chongNot", "not");this.put("chong", chong);return this;};
	/** and chong <= ? */
	this.chongMin=function(min){if(this.proxy)return this.getProxy().chongMin(min);this.put("chongMin", min);return this;};
	/** and chong >= ? */
	this.chongMax=function(max){if(this.proxy)return this.getProxy().chongMax(max);this.put("chongMax", max);return this;};
	this.chongIn=function(ids){
		if(this.proxy)return this.getProxy().chongIn(ids);  this.put("chongIn", ids);return this;
	};	
	
	/** 赠        **/
	this.zeng=function(zeng){if(this.proxy)return this.getProxy().zeng(zeng);  this.put("zeng", zeng);return this;};
	/** and zeng is null */
	this.zengNull=function(){if(this.proxy)return this.getProxy().zengNull();if(this.get("zengNot")==null)this.put("zengNot", "");this.put("zeng", null);return this;};
	/** not .... */
	this.zengNot=function(){if(this.proxy)return this.getProxy().zengNot();this.put("zengNot", "not");return this;};
	this.zengNotNull=function(){if(this.proxy)return this.getProxy().zengNotNull();this.put("zengNot", "not");this.put("zeng", null);return this;};
	this.zengNot=function(zeng){if(this.proxy)return this.getProxy().zengNot(zeng);this.put("zengNot", "not");this.put("zeng", zeng);return this;};
	/** and zeng <= ? */
	this.zengMin=function(min){if(this.proxy)return this.getProxy().zengMin(min);this.put("zengMin", min);return this;};
	/** and zeng >= ? */
	this.zengMax=function(max){if(this.proxy)return this.getProxy().zengMax(max);this.put("zengMax", max);return this;};
	this.zengIn=function(ids){
		if(this.proxy)return this.getProxy().zengIn(ids);  this.put("zengIn", ids);return this;
	};	
	
	/** 获得时间 [非空]       **/
	this.addTime=function(addTime){if(this.proxy)return this.getProxy().addTime(addTime);  this.put("addTime", addTime);return this;};
	/** and add_time is null */
	this.addTimeNull=function(){if(this.proxy)return this.getProxy().addTimeNull();if(this.get("addTimeNot")==null)this.put("addTimeNot", "");this.put("addTime", null);return this;};
	/** not .... */
	this.addTimeNot=function(){if(this.proxy)return this.getProxy().addTimeNot();this.put("addTimeNot", "not");return this;};
	this.addTimeNotNull=function(){if(this.proxy)return this.getProxy().addTimeNotNull();this.put("addTimeNot", "not");this.put("addTime", null);return this;};
	this.addTimeNot=function(addTime){if(this.proxy)return this.getProxy().addTimeNot(addTime);this.put("addTimeNot", "not");this.put("addTime", addTime);return this;};
	/** and add_time >= ? */
	this.addTimeStart=function(start){if(this.proxy)return this.getProxy().addTimeStart(start);this.put("addTimeStart", start);return this;};			
	/** and add_time <= ? */
	this.addTimeEnd=function(end){if(this.proxy)return this.getProxy().addTimeEnd(end);this.put("addTimeEnd", end);return this;};
	
	/** 状态 [非空]   1:正常 0:无效     **/
	this.status=function(status){if(this.proxy)return this.getProxy().status(status);  this.put("status", status);return this;};
	/** and status is null */
	this.statusNull=function(){if(this.proxy)return this.getProxy().statusNull();if(this.get("statusNot")==null)this.put("statusNot", "");this.put("status", null);return this;};
	/** not .... */
	this.statusNot=function(){if(this.proxy)return this.getProxy().statusNot();this.put("statusNot", "not");return this;};
	this.statusNotNull=function(){if(this.proxy)return this.getProxy().statusNotNull();this.put("statusNot", "not");this.put("status", null);return this;};
	this.statusNot=function(status){if(this.proxy)return this.getProxy().statusNot(status);this.put("statusNot", "not");this.put("status", status);return this;};
	this.statusIn=function(ids){
		if(this.proxy)return this.getProxy().statusIn(ids);  this.put("statusIn", ids);return this;
	};	
	
	
	
	this.add=function(key,value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	this.desc=function(sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	this.asc=function(sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	this.definex=function(sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	
	/** 获取所有余额获得明细 **/
	this.list=function(size){
		this.data.size = size;
		var protocol = ux.ajax("/admin/products/productdetails.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list)return protocol.data.list;
		return [];
	}
	/** 获取余额获得明细分页 **/
	this.page=function(page,size){
		this.data.size = size;
		this.data.page = page;
		var protocol = ux.ajax("/admin/products/productdetails.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data)return data;
		return {list:[]};
	}
	/** 根据查询条件取余额获得明细 **/
	this.get=function(){
		this.data.size = 1;
		var protocol = ux.ajax("/admin/products/productdetails.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list && protocol.data.list.length==1)return protocol.data.list[0]; 
		return null;
	}
}

ProductDetails.get = function(id){
	var protocol = ux.ajax("/admin/products/productdetails.get.do",{id:id});
	if(!protocol)return null;
	if(protocol.data)return protocol.data.productDetails;
	return null;
}

ProductDetails.where = new ProductDetails.Where(0,true);